package com.bianmaba;

import com.bianmaba.services.datacollection.TaskRunLogWriter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import java.util.concurrent.ExecutorService;

@Component
public class StartupRunner implements CommandLineRunner {
    @Autowired
    private TaskRunLogWriter logWriter;
    @Autowired
    private ExecutorService executorService;

    @Override
    public void run(String... args) throws Exception {
        executorService.execute(logWriter);
    }
}
